import java.util.Scanner;

public final class Poker {
    
    private Poker() {
        //not called
    }
	public static void main(final String[] args) {
		System.out.println("Poker game");
		System.out.println("How many players? (2-4)");
		Scanner sc = new Scanner(System.in);
		String input = "y";
		int players = sc.nextInt();
		Table table;
		System.out.println("How many human players?");
		int human = sc.nextInt();
		System.out.println("Starting amount?");
		int startamount = sc.nextInt();
		System.out.println("Blind amount?");
		int blind = sc.nextInt();
		try {
			table = new Table(players, human, startamount, blind);
		} catch (PokerException e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
			sc.close();
			return;
		}
		while (!input.equals("n")) {// && table.getPlayersLeft() >= 2) {
			try {
                table.play();
            } catch (PokerException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }                                                   // zebym nie napsul tym wyjatkiem
			System.out.println("Play again y/n?");
			input = sc.next();
		}
		sc.close();
	}
}
